home *** CD-ROM | disk | FTP | other *** search
/ WINMX Assorted Textfiles / Ebooks.tar / Text - Tech - Hacking - TTY Spoofing (TXT).rar / ttyspoof.txt
Text File  |  2003-09-28  |  8KB  |  97 lines

  1.                               TTY SPOOFING
  2.                                    by
  3.                                 SubEthan
  4.  
  5.   I know what you are going to say...  "THAT WAS ALREADY COVERED BY VAXBUSTER
  6. IN PHRACK-41!" Yeah, I know, but if you would shut your mouth for long
  7. enough and pay attention you might learn something.  This file is meant to
  8. be a follow up of VaxBuster's very informative article on TTY spoofing. 
  9. Vax does a great job in explaining how TTY spoofing works, but falls short
  10. in a few areas.  This article will NOT repeat anything said in VaxBuster's
  11. article so if you haven't read it go do it now or just be confused.
  12.  
  13.   Manual TTY spoofing is made out to look SOOO easy by VaxBuster, but when
  14. I recieved my issue of Phrack-41 I (of course) immediately tried some TTY
  15. spoofing of my own.  Well needless to say I figured it out, but it wasn't
  16. quite as simple as cating the TTYs and waiting.  One of the most
  17. immediate problems is finding out what TTY's are used for what purposes. 
  18. Many machines, especially larger machines, can have HUNDREDS of TTYs. 
  19. Some are obviously for devices such as printers and modems, while others
  20. are set aside for "scum" student users, and still others might be for
  21. "special" users.  My advise is to take a tour of your /dev direcotry.  Get
  22. to know it, because even beyond TTY spoofing there are many things that
  23. can be done in the /dev directory.  When you look at all the TTYs in the
  24. /dev directory look for ones whose owner isn't "root" and don't just check
  25. it once, check it at different times of the day and keep a log of
  26. patterns, such as where maybe the modem users are and where the CIS lab
  27. terminal TTYs are.  Not all computers have different TTYs for different
  28. groups of users, but if you keep your eyes open you may notice things that
  29. will be to your advantage later.
  30.  
  31.   Now once you figure out what TTYs the bulk of users you might want to
  32. spoof are on, then you can start cating terminals and wham, bam, thank you
  33. ma'm you magically get accounts, right?  Wrong.
  34.   
  35.   Even after you know the best TTY areas for spoofing, there are still
  36. some problems.  One of the biggest problems I had when spoofing was this: 
  37. once I catted an unused TTY, that TTY was skipped over by the login
  38. process.  If I catted a whole area of TTYs that whole area of TTY was
  39. skipped over and it looks pretty obvious something is up when you look at
  40. a "who" and there is a gap of TTYs about 30 long that don't have users. 
  41. The obvious solution to this problem is, of course to cat ALL the TTYs.  
  42. I have a slight problem with that though.  There are just TOO many TTYs to
  43. spoof.  The normal use TTYs on my machine go from ttyx1 to ttyx255. 
  44. That's right 255 TTYs!  And don't tell me cats don't show up in a ps -aux
  45. because they do.  It would look pretty suspicous if your name were on the
  46. process list with 255 cats running.
  47.  
  48.   Needless to say I needed to find out more about how the TTYs worked.  I
  49. found that every once in while when I did cat a large area of TTYs I could
  50. snag a user, but then I would just end up killing all the other process
  51. after five minutes because I noticed that the TTYs I still had catted
  52. started to get skipped.  After a while of playing I figured out that the
  53. users I would snag were through PURE LUCK.  While catted TTYs are skipped
  54. over, what happens is you can actually cat someones terminal as they are
  55. logging in!  This is what happens most of the time.  I came up with a
  56. process to better my chances of "snagging" some poor schmuck as he is
  57. logging in.  
  58.  
  59.   Now as most people know, (or maybe not so I'm telling you anyway) TTYs
  60. are distributed numerically.  ttyx1 (or whatever your first tty?? happens
  61. to be) is given out before ttyx2 and so on down the line.  Now if ttyx1
  62. through ttyx10 are used and the person using ttyx2 logs off, then ttyx2 is
  63. the next tty to be given out to the next user who logs in.  This I believe
  64. generally holds true on most machines (although I am not positive).  Now
  65. in order to optimize getting ttys here is what you can do.
  66.  
  67.   First you log in (to whichever hacked account you prefer, although with
  68. this method I genereally don't fear using my own) during busy hours and find
  69. which tty you are on by doing a ps.  Now most of the time, especially
  70. during VERY busy hours you will tend to slip into the middle of the used
  71. ttys.  This is because someone has dropped out of the middle and you have
  72. gotten that tty.  Now what you want to do is try to identify a LOW numbered
  73. unused tty. You COULD keep doing whos to see who drops off of a low
  74. numbered tty, but here is what I do to maximize efficiency.  Just Telnet to
  75. your own machine and log in again.  This guarantees that you will find out the
  76. lowest number open tty on your machine, plus since you are logged in no
  77. one else will be able to take.  This TTY is the one you will spoof. 
  78. It is very important that the tty number be as low as possible.  You will
  79. see why later.
  80.  
  81.   Now say you originally logged on to ttyx55 and then when you Telneted to
  82. your own machine you managed to get ttyx7.  What you want to do now is
  83. logout off of ttyx7 putting you back to ttyx55.  Now right away cat that
  84. sucker!
  85.  
  86. cat < /dev/ttyx7 &
  87.  
  88.   Alright.  Now if you don't get a "permission denied" error you got it.  If
  89. you do get "permission denied" try the whole process again.  
  90.  
  91.   Once you get a low tty cated you are in good shape.  Now unless, as I
  92. said before, someone is logging in at the same time as you cat the terminal
  93. then nothing will happen.  The tty you catted will be skipped over.  Now
  94. you want to typ% the cgmlAndq fg2 the "<-j@O!<_sÄâsaL'AçAÄçAA8@A'AAA xxDA'àgæ@A l have to go through the proccess again and heaven forbid
  95. you should actually have to work for anything.
  96.  
  97.